////////////////////////////////////////////////////////////////////////////////////////
// Stauffer Public Perceptions of Women's Inclusion and Feelings of Political Efficacy
// Replication Code - Appendix 11a
///////////////////////////////////////////////////////////////////////////////////////

***********
// TABLE A12
***********

*set working directory
use 1618_CCES.dta, clear 

*2016 OLS
xtmixed approve c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen gender_r woman_rep gender_r c.stateleg gender_r ///
if year==2016 ||state:, cov(uns)

estimates store sixteena_ols

xtmixed approve c.r_estimate##gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen##gender_r woman_rep##gender_r c.stateleg##gender_r ///
if year==2016 ||state:, cov(uns)

estimates store sixteenb_ols

*2016 Ordered 
meoprobit approve c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen gender_r woman_rep gender_r c.stateleg gender_r ///
if year==2016 ||state:, cov(uns)

estimates store sixteena_ordered

meoprobit approve c.r_estimate##gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen##gender_r woman_rep##gender_r c.stateleg##gender_r ///
if year==2016 ||state:, cov(uns)

estimates store sixteenb_ordered

*2018 OLS
xtmixed approve c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen gender_r woman_rep gender_r c.stateleg gender_r ///
if year==2018 ||state:, cov(uns)

estimates store eighteena_ols

xtmixed approve c.r_estimate##gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen##gender_r woman_rep##gender_r c.stateleg##gender_r ///
if year==2018 ||state:, cov(uns)

estimates store eighteenb_ols

*2018 Ordered 
meoprobit approve c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen gender_r woman_rep gender_r c.stateleg gender_r ///
if year==2018 ||state:, cov(uns)
estimates store eighteena_ordered

meoprobit approve c.r_estimate##gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen##gender_r woman_rep##gender_r c.stateleg##gender_r ///
if year==2018 ||state:, cov(uns)
estimates store eighteenb_ordered 


*2017 OLS

use 17_CCES.dta, clear 

xtmixed house_approve c.cong_guess gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen gender_r woman_rep gender_r c.state gender_r  ||StateAbbr:, cov(uns)

 estimates store seventeena_ols
 
 xtmixed house_approve c.cong_guess##gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen##gender_r woman_rep##gender_r c.state##gender_r  ||StateAbbr:, cov(uns)
 
estimates store seventeenb_ols

*2017 Ordered
meoprobit house_approve c.cong_guess gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen gender_r woman_rep gender_r c.state gender_r ///
 ||StateAbbr:, cov(uns)
 
 estimates store seventeena_ordered
 
 meoprobit house_approve c.cong_guess##gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen##gender_r woman_rep##gender_r c.state##gender_r ///
 ||StateAbbr:, cov(uns)
 
estimates store seventeenb_ordered 


*Generate LaTex code for table 
estout sixteena_ols sixteena_ordered sixteenb_ols sixteenb_ordered /// 
seventeena_ols seventeena_ordered seventeenb_ols seventeenb_ordered ///
eighteena_ols eighteena_ordered eighteenb_ols eighteenb_ordered , ///
 cells(b(star fmt(%9.3f)) se(par)) ///
style(tex) stats(N) nobaselevels interaction ("X") starlevels (* .1 ** .05 *** .01)
